package com.wzy.activiti;

import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngines;
import org.activiti.engine.TaskService;
import org.activiti.engine.task.Task;

/**
 * 下唇当前用户的任务列表
 */
public class ActivitiCompleteTask {
    public static void main(String[] args) {
        //得到processEngine对象
        ProcessEngine defaultProcessEngine = ProcessEngines.getDefaultProcessEngine();

        //2.得到TaskService对象
        TaskService taskService = defaultProcessEngine.getTaskService();
        Task task = taskService.createTaskQuery().processDefinitionKey("holiday2").taskAssignee("Tony马").singleResult();

        //3.处理任务,结合当前用户当前任务列表查询操作的话,任务的ID2505,
        taskService.complete(task.getId());


    }
}
